
/*Enforcement Analysis
STATA 14
January 12, 2017
Replicates  Tables 3 and 4*/


cd  "C:\Users\ejm5\Dropbox\Rents_Asunder\CountryofOrigin\20160315_InternationaOrganization\Replication"
use  oecd_7years_working.dta, clear
log using enforcement.smcl, replace

/*Pause Turned On to Stop at Main Replication Figures and Tables*/
pause on

/*Drop all firms that entered very early*/
drop if a1<2005



/*At Time of Entry*/
generate oecd_enforce_simple=0 if oecd==0
replace oecd_enforce_simple=1 if enforce_scale_entry>0 & enforce_scale_entry<2
replace oecd_enforce_simple=2 if enforce_scale_entry>=2 & enforce_scale_entry<=4

label variable oecd_enforce_simple "Enforcement (Transparency International)"
label values oecd_enforce_simple enforce
label define enforce 0 "Non-Signatory" 1 "None" 2 "Some" 
generate phase3_enforce=phase3*oecd_enforce_simple

save oecd_7years_final.dta, replace




/**********************Table 4 ENFORCE Entry********************/

/*Interaction Effects*/

/*Model 1*/

#delimit cr
set more off
nbreg c6 i.phase3##i.oecd_enforce_simple  if treatment==0,  cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
reg bribe i.phase3##i.oecd_enforce_simple if treatment==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T4_Model1
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll ) replace
drop ns_items bribe


/*Model 2*/
set more off
nbreg c6 i.phase3##i.oecd_enforce_simple  y2 y3 y4 y5 y6 y7  if treatment==0,  cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
reg bribe i.phase3##i.oecd_enforce_simple   y2 y3 y4 y5 y6 y7 if treatment==1,  cluster(pci_id) vce(bootstrap, reps(1000))  
estimates store T4_Model2
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe

/*Model 3*/
set more off
nbreg c6 i.phase3##i.oecd_enforce_simple  y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5  if treatment==0,  cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
reg bribe i.phase3##i.oecd_enforce_simple   y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5 if treatment==1,  cluster(pci_id) vce(bootstrap, reps(1000))  
estimates store T4_Model3
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll )
drop ns_items bribe

/*Model 4*/
set more off
nbreg c6 i.phase3##i.oecd_enforce_simple  y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 if treatment==0,  cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
reg bribe i.phase3##i.oecd_enforce_simple   y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 if treatment==1,  cluster(pci_id) vce(bootstrap, reps(1000))  
estimates store T4_Model4
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe

/*Model 5*/
set more off
nbreg c6 i.phase3##i.oecd_enforce_simple  y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2   if treatment==0,  cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
reg bribe i.phase3##i.oecd_enforce_simple   y2 y3 y4 y5 y6 y7 a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2  if treatment==1,  cluster(pci_id)  vce(bootstrap, reps(1000))  
estimates store T4_Model5
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe


/*Model 6*/
set more off
areg c6 i.phase3_enforce i.year a6_1 a6_2 a6_3 a6_4 a6_5  hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2 i.a1 if treatment==0, absorb(country_id) cluster(pci_id) 
predict ns_items
generate bribe=c6-ns_items
areg bribe i.phase3_enforce i.year a6_1 a6_2 a6_3 a6_4 a6_5  hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2 i.a1 if treatment==1, absorb(country_id)  cluster(pci_id)  vce(bootstrap, reps(1000)) 
estimates store T4_Model6
outreg2 using 20161125_Enforce2,  bdec(3) tdec(3) e(N rmse ll ) excel
drop ns_items bribe


/*LR TESTS*/
lrtest T4_Model1 T4_Model2, stats force
lrtest T4_Model1 T4_Model3, stats force
lrtest T4_Model1 T4_Model4, stats force
lrtest T4_Model1 T4_Model5, stats force
lrtest T4_Model1 T4_Model6, stats force
pause

*****************************************************************************************************************************************************************

/*Table 5 Enfocement Procurement*/


/*Firms question with different number of values and question wording*/
drop if year==2012


/*At Time of Survey*/
generate oecd_enforce_simple_svy=0 if oecd==0
replace oecd_enforce_simple_svy=1 if enforce_scale>0 & enforce_scale<2
replace oecd_enforce_simple_svy=2 if enforce_scale>=2 & enforce_scale<=4

label variable oecd_enforce_simple_svy "Enforcement (Transparency International)"
label values oecd_enforce_simple_svy enforce


/*Model 1*/
set more off
nbreg e9 i.oecd_enforce_simple_svy  if treatment2==0,  cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
reg bribe i.oecd_enforce_simple_svy  if treatment2==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model1
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) replace
drop ns_items bribe


/*Model 2*/
set more off
nbreg e9 i.oecd_enforce_simple_svy i.year  if treatment2==0,  cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
reg bribe i.oecd_enforce_simple_svy i.year  if treatment2==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model2
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe


/*Model 3*/
set more off
nbreg e9 i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 i.year  if treatment2==0,  cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
reg bribe i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 i.year  if treatment2==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model3
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe


/*Model 4*/
set more off
nbreg e9 i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est   d2 i.year  if treatment2==0,  cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
reg bribe i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est   d2 i.year  if treatment2==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model4
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe


/*Model 5*/
set more off
nbreg e9 i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2 i.year  if treatment2==0,  cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
reg bribe i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est   d2 ln_gdp_pc ln_pop p_polity2 i.year  if treatment2==1,  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model5
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) 
drop ns_items bribe

/*Model 6*/
set more off
areg e9 i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est  d2 ln_gdp_pc ln_pop p_polity2 i.year   if treatment2==0, absorb(a1) cluster(pci_id) 
predict ns_items
generate bribe=e9-ns_items
areg bribe i.oecd_enforce_simple_svy a6_1 a6_2 a6_3 a6_4 a6_5 hundred  labor_est   d2 ln_gdp_pc ln_pop p_polity2 i.year   if treatment2==1, absorb(a1)  cluster(pci_id) vce(bootstrap, reps(1000))
estimates store T5_Model6
outreg2 using 20161125_Enforce2_proc,  bdec(3) tdec(3) e(N rmse ll ) excel
drop ns_items bribe




/*LR TESTS*/
lrtest T5_Model1 T5_Model2, stats force
lrtest T5_Model1 T5_Model3, stats force
lrtest T5_Model1 T5_Model4, stats force
lrtest T5_Model1 T5_Model5, stats force
lrtest T5_Model1 T5_Model6, stats force
log close







